package 测验题;

import java.util.Scanner;

public class Main1 {
  //依次输入一元二次方程的系数，求解这个方程
	//ax^2+bx+c=0
	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		System.out.print("请输入二次系数a=");
		double a=input.nextInt();
		System.out.print("请输入系数b=");
		double b=input.nextInt();
		System.out.print("请输入常数项c=");
		double c=input.nextInt();
		if((b*b-4*a*c)<0){
			System.out.println("该方程无解！");
		}else{
			double gen=Math.sqrt((b*b-4*a*c));
			double jie1=(-b+gen)/(2*a);
			double jie2=(-b-gen)/(2*a);
			System.out.println("实数解一为："+jie1);
			System.out.println("实数解二为："+jie2);
		}
	}
}